import request from '@/utils/request'

export function apiGetList(params, loading) {
  return request({
    url: `/obj/busServiceController/list`,
    method: 'get',
    params,
    loading,
    autoUntie: false,
  })
}

export function apiAdd(data) {
  return request({
    url: '/obj/busServiceController/add',
    method: 'post',
    data: data,
  })
}
export function apiEdit(data) {
  return request({
    url: '/obj/busServiceController/edit',
    method: 'put',
    data: data,
  })
}

export function apiDel(ids) {
  return request({
    url: '/obj/busServiceController/' + ids,
    method: 'delete',
  })
}

// 扫描对象
export const apiScanObject = (url, data) => {
  return request({
    url: `${url}/busServiceHandler/scanByService`,
    method: 'post',
    data,
  })
}
// 获取扫描进度
export const apiGetScanProgress = (url, params) => {
  return request({
    url: `${url}/busServiceHandler/listProgress`,
    method: 'get',
    params,
    resField: 'data',
  })
}
